/*
 * @Author: zhangyun
 * @Date: 2021-04-27 15:19:17
 * @LastEditors: zhangyun
 * @LastEditTime: 2021-04-27 15:53:35
 * @Desc: 
 */
export function parseTime(date:string, type:string):string {
  const dateTime = new Date(date)
  const year = dateTime.getFullYear()
  let month:number|string = dateTime.getMonth() + 1;
  month = month > 0 && month <=9 ? '0' + month : month
  let day:number|string = dateTime.getDate()
  day = day > 0 && day <= 9 ? '0' + day : day
  switch(type) {
    case 'yyyy/MM/dd':
      return `${year}/${month}/${day}`
    default:
      return `${year}/${month}/${day}`
  }
}